<?php

namespace addons\smz;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Smz extends Addons
{


    protected  $menu = [
        [
            'name' => 'smz',
            'title' => '实名制名单',
            'icon' => 'fa fa-list',
            'ismenu' => 1,
            'py' => 's',
            'pinyin' => 'smz',
            'sublist' =>
            [
                [
                    'name' => 'smz/smz',
                    'title' => '实名制名单',
                    'icon' => 'fa fa-circle-o ',
                    'ismenu' => 1,
                    'py' => 'smzmd',
                    'pinyin' => 'shimingzhimingdan',
                    'weigh' => 0,
                    'sublist' =>
                    [
                        [
                            'name' => 'smz/smz/import',
                            'title' => '导入',
                        ],
                        [
                            'name' => 'smz/smz/index',
                            'title' => '查看',
                        ],
                        [
                            'name' => 'smz/smz/recyclebin',
                            'title' => '回收站',
                        ],
                        [
                            'name' => 'smz/smz/add',
                            'title' => '添加',
                        ],
                        [
                            'name' => 'smz/smz/edit',
                            'title' => '编辑',
                        ],
                        [
                            'name' => 'smz/smz/del',
                            'title' => '删除',
                        ],
                        [
                            'name' => 'smz/smz/destroy',
                            'title' => '真实删除',
                        ],
                        [
                            'name' => 'smz/smz/restore',
                            'title' => '还原',
                        ],
                        [
                            'name' => 'smz/smz/multi',
                            'title' => '批量更新',
                        ],
                        [
                            'name' => 'smz/smz/dc',
                            'title' => '导出名单',
                        ],
                    ],
                ],
            ],
        ],
    ];



    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        Menu::create($this->menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete('smz');
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable('smz');
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable('smz');
        return true;
    }
}
